<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="UTF-8">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/font-awesome.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/main.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/carousel.css">
    <style>
        .tree li {
            list-style-type: none;
            cursor: pointer;
        }

        table tbody tr:nth-child(odd) {
            background: #F4F4F4;
        }

        table tbody td:nth-child(even) {
            color: #C00;
        }

        #logoimg {
            width: 150px;
            position: absolute;
            left: 15px;
            padding: 5px 5px;
        }

        #logodiv {
            position: absolute;
            left: 165px;
        }
    </style>
</head>

<body>
<div class="navbar-wrapper ">
    <%--动态导入另一个jsp页面，作用：将公共使用的部分提取出来，然后使用动态导入
              动态导入是不会导入include页面的编译指令的，而是仅仅将被导入页面的body内容插入本页面。--%>
    <jsp:include page="admin-header.jsp"></jsp:include>
</div>
<div class="container-fluid">
    <div class="row">
        <%--动态导入另一个jsp页面，作用：将公共使用的部分提取出来，然后使用动态导入
             动态导入是不会导入include页面的编译指令的，而是仅仅将被导入页面的body内容插入本页面。--%>
        <jsp:include page="admin-left.jsp"></jsp:include>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="glyphicon glyphicon-th"></i> 改派负责人
                        <div style="float: right">
                            <button onclick="location.replace('/tbGaipai/searchGaipais');" class="btn btn-success">返回
                            </button>
                        </div>
                    </h3>
                </div>
                <div class="panel-body">
                    <form id="setStatuForm" action="/tbGaipai/pizhunNew" method="post" class="form-horizontal"
                          role="form">
                        <div class="form-group">
                            <input style="display: none" name="gaipaiId" value="${tbGaipai.gaipaiId}">
                            <input style="display: none" name="gaipaiStatu" value="${tbGaipai.gaipaiStatu}">
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">原负责人：</label>
                            <div class="col-sm-8">
                                <input class="form-control" readonly style="font-size:12pt;"
                                       value="${tbGaipai.tbOrder.tbLeader.leaderName}"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">申请理由：</label>
                            <div class="col-sm-8">
                                <input class="form-control" readonly style="font-size:12pt;"
                                       value="${tbGaipai.gaipaiWhy}"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">新维修负责人：</label>
                            <div class="col-sm-8">
                                <select name="leaderId" class="form-control">
                                    <c:forEach var="leader" items="${tbLeaders}">
                                        <option value="${leader.leaderId}">${leader.leaderName}</option>
                                    </c:forEach>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" id="btnSubmit" class="btn btn-primary tooltip-show"
                                        data-toggle="tooltip">确定改派负责人
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="glyphicon glyphicon-th"></i> 报修单详情</h3>
                </div>
                <div class="panel-body">
                    <div class="form">
                        <div class="form-group ">
                            <label>
                                标题：</label>
                            ${tbOrder.machineModel}
                        </div>
                        <div class="form-group ">
                            <label>
                                缓急程度：</label>
                            <span class='text-primary'>${tbOrder.problemLever}</span>
                        </div>
                        <div class="form-group ">
                            <label>
                                联系人：</label>
                            ${tbOrder.lianxiUser }
                        </div>
                        <div class="form-group ">
                            <label>
                                联系电话：</label>
                            ${tbOrder.lianxiTel }
                        </div>
                        <div class="form-group ">
                            <label>
                                报修地址：</label>
                            ${tbOrder.machineAddress}
                        </div>
                        <div class="form-group ">
                            <label>
                                维修负责人：</label>
                            ${tbOrder.tbLeader.leaderName }
                        </div>
                        <div class="form-group ">
                            <label>
                                问题描述：</label>
                            ${tbOrder.problemDesc}
                        </div>
                        <div class="form-group ">
                            <label>
                                申请时间：</label>
                            <fmt:formatDate value="${tbOrder.addTime}" pattern="yyyy-MM-dd"/>
                        </div>
                        <div class="form-group ">
                            <label>
                                照片：</label>
                            <c:if test="${tbOrder.orderImg1 !=null}">
                                <img class="img-responsive" alt="Responsive image" alt="图片XX"

                                     src="/upload/${tbOrder.orderImg1}"/></c:if>
                            <c:if test="${tbOrder.orderImg1 ==null}">
                                <img class="img-responsive" alt="图片XX"/></c:if>
                            <c:if test="${tbOrder.orderImg2 !=null}">
                                <img class="img-responsive" alt="Responsive image" alt="图片XX"
                                     src="/upload/${tbOrder.orderImg2}"/></c:if>
                            <c:if test="${tbOrder.orderImg2 ==null}">
                                <img class="img-responsive" alt="图片XX"/></c:if>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<script src="${pageContext.request.contextPath}/resources/jquery/jquery-2.1.1.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/script/docs.min.js"></script>
<script type="text/javascript">
    $(function () {

        $(".list-group-item").click(function () {
            if ($(this).find("ul")) {
                $(this).toggleClass("tree-closed");
                if ($(this).hasClass("tree-closed")) {
                    $("ul", this).hide("fast");
                } else {
                    $("ul", this).show("fast");
                }
            }
        });
        $("#setStatuForm").on('click', '.btn-default', function () {
            console.log(11111111111111);
            $("#statuDesc").val('该报修申请无需维修。');
        });
        $("#setStatuForm").on('click', '.btn-warning', function () {
            console.log(2222222222);
            $("#statuDesc").val('已在处理该报修申请。');
        });
        $("#setStatuForm").on('click', '.btn-success', function () {
            console.log(33333333333);
            $("#statuDesc").val('报修申请已完成维修。');
        });

    });

</script>
</body>
</html>
